// 现代化组件样式库

// 加载动画
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  
  .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid $primary;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

// 现代化搜索框
.modern-search {
  position: relative;
  
  .el-input {
    .el-input__inner {
      padding-left: 40px;
      border-radius: 20px;
      border: 2px solid #e8e8e8;
      transition: all 0.3s ease;
      
      &:focus {
        border-color: $primary;
        box-shadow: 0 0 0 3px rgba($primary, 0.1);
      }
    }
  }
  
  .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    z-index: 10;
  }
}

// 状态标签
.status-tag {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  
  &.success {
    background: rgba($success, 0.1);
    color: $success;
    border: 1px solid rgba($success, 0.2);
  }
  
  &.warning {
    background: rgba($warning, 0.1);
    color: $warning;
    border: 1px solid rgba($warning, 0.2);
  }
  
  &.danger {
    background: rgba($error, 0.1);
    color: $error;
    border: 1px solid rgba($error, 0.2);
  }
  
  &.info {
    background: rgba($info, 0.1);
    color: $info;
    border: 1px solid rgba($info, 0.2);
  }
}

// 现代化工具栏
.modern-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 16px;
  
  .toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }
}

// 数据统计卡片
.stats-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30px, -30px);
  }
  
  .stats-title {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 8px;
  }
  
  .stats-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
  }
  
  .stats-change {
    font-size: 12px;
    opacity: 0.9;
    
    &.positive {
      color: #4ade80;
    }
    
    &.negative {
      color: #f87171;
    }
  }
}

// 现代化表单组
.form-group {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
  
  .form-group-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
  }
}

// 空状态
.empty-state {
  text-align: center;
  padding: 60px 20px;
  
  .empty-icon {
    font-size: 64px;
    color: #d9d9d9;
    margin-bottom: 16px;
  }
  
  .empty-title {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
  }
  
  .empty-description {
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
  }
}

// 操作按钮组
.action-buttons {
  display: flex;
  gap: 8px;
  
  .el-button {
    &.el-button--text {
      padding: 4px 8px;
      font-size: 12px;
      
      &:hover {
        background: rgba($primary, 0.1);
      }
    }
  }
}

// 响应式网格
.responsive-grid {
  display: grid;
  gap: 16px;
  
  &.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
  
  &.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  &.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

// 现代化滚动条
.modern-scrollbar {
  &::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  
  &::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }
  
  &::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
    
    &:hover {
      background: #a8a8a8;
    }
  }
}

// 浮动操作按钮
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: $primary;
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba($primary, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1000;
  
  &:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba($primary, 0.6);
  }
  
  &:active {
    transform: scale(0.95);
  }
}

// 通知徽章
.notification-badge {
  position: relative;
  
  &::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: $error;
    border-radius: 50%;
    border: 2px solid white;
  }
  
  &.has-count::after {
    content: attr(data-count);
    width: auto;
    height: auto;
    min-width: 16px;
    padding: 2px 4px;
    font-size: 10px;
    line-height: 1;
    text-align: center;
    color: white;
  }
}